package com.ats.web.managed;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

@ManagedBean(name = "commonMB")
@SessionScoped
public class CommonMB {

		private String locale = "ar";
		private String dir = "rtl";
		
		public void changeLang(String locale){
			setLocale(locale);
		}
		

		/**
		 * @return the locale
		 */
		public String getLocale() {
			return locale;
		}

		/**
		 * @param locale the locale to set
		 */
		public void setLocale(String locale) {
			this.locale = locale;
			
		}


		/**
		 * @return the dir
		 */
		public String getDir() {
			if(getLocale().equals("ar"))
				dir = "rtl";
			else
				dir = "ltr";
			
			return dir;
		}


		/**
		 * @param dir the dir to set
		 */
		public void setDir(String dir) {
			this.dir = dir;
		}
}
